/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.fl.entity;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 内容管理Entity
 * @author anthony
 * @version 2019-01-07
 */
@Table(name="fl_content", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="type", attrName="type", label="栏目"),
		@Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE),
		@Column(name="img_paths", attrName="imgPaths", label="图片路径"),
		@Column(name="img_names", attrName="imgNames", label="图片标题"),
		@Column(name="enterprises", attrName="enterprises", label="针对的企业", queryType=QueryType.LIKE),
		@Column(name="content", attrName="content", label="内容", queryType=QueryType.LIKE),
		@Column(name="attach_paths", attrName="attachPaths", label="附件路径"),
		@Column(name="attach_names", attrName="attachNames", label="附件标题"),
		@Column(name="start_date", attrName="startDate", label="有效开始时间"),
		@Column(name="end_date", attrName="endDate", label="有效结束时间"),
		@Column(name="lang", attrName="lang", label="语言"),
		@Column(name="summary", attrName="summary", label="摘要"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class Content extends DataEntity<Content> {
	
	private static final long serialVersionUID = 1L;
	private String type;		// 栏目
	private String title;		// 标题
	private String imgPaths;		// 图片路径
	private String imgNames;		// 图片标题
	private String enterprises;		// 针对的企业
	private String content;		// 内容
	private String attachPaths;		// 附件路径
	private String attachNames;		// 附件标题
	private Date startDate;		// 有效开始时间
	private Date endDate;		// 有效结束时间
	private String filterOwner; //过滤出是否是我的,1为是，0为否
	private String lang;//语言：1为中文，2为英文
	private String summary; //摘要
	
	public Content() {
		this(null);
	}

	public Content(String id){
		super(id);
	}
	
	@Length(min=0, max=100, message="栏目长度不能超过 100 个字符")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@NotBlank(message="标题不能为空")
	@Length(min=0, max=255, message="标题长度不能超过 255 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getImgPaths() {
		return imgPaths;
	}

	public void setImgPaths(String imgPaths) {
		this.imgPaths = imgPaths;
	}
	
	public String getImgNames() {
		return imgNames;
	}

	public void setImgNames(String imgNames) {
		this.imgNames = imgNames;
	}

	@Length(min=0, max=64, message="针对的企业长度不能超过 64 个字符")
	public String getEnterprises() {
		return enterprises;
	}

	public void setEnterprises(String enterprises) {
		this.enterprises = enterprises;
	}
	
	@NotBlank(message="内容不能为空")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public String getAttachPaths() {
		return attachPaths;
	}

	public void setAttachPaths(String attachPaths) {
		this.attachPaths = attachPaths;
	}
	
	public String getAttachNames() {
		return attachNames;
	}

	public void setAttachNames(String attachNames) {
		this.attachNames = attachNames;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getFilterOwner() {
		return filterOwner;
	}

	public void setFilterOwner(String filterOwner) {
		this.filterOwner = filterOwner;
	}

	public String getLang() {
		return lang;
	}

	public void setLang(String lang) {
		this.lang = lang;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}
}